/**
 * Copyright ©2012-2018 HopeHaiyang Corporation, All Rights Reserved
 * http://www.wuhanhope.com
 */
package hope.platform.data.web;

import hope.platform.data.domain.Typhoon;
import hope.platform.data.server.header.TyphoonInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * class info
 * @author Lizhangqing
 * @see
 * @since
 * Create at 2018/7/23
 */
@RestController
@RequestMapping("/typhoon")
public class TyphoonInfoController {
    @Autowired
    private TyphoonInfoService typhoonInfoService;

    @RequestMapping(value = "/detail/{tfbh}", method = RequestMethod.GET)
    public List<Typhoon> getTyphoonInfoByTfbh(@PathVariable String tfbh) throws Exception {
        return typhoonInfoService.getTyphoonInfoByTfbh(tfbh);
    }

    @RequestMapping(value = "/list/{year}",method = RequestMethod.GET)
    public List<Typhoon> getTyphoonInfoByYear(@PathVariable Integer year) throws Exception {
        return typhoonInfoService.getTyphoonInfoByYear(year);
    }
}
